package org.shangrila.bme.eo;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.List;
import java.math.BigDecimal;


/**
 * The persistent class for the bme_contract database table.
 * 
 */
@Entity
@Table(name="bme_contract")
@NamedQuery(name="BmeContract.findAll", query="SELECT b FROM BmeContract b")
public class BmeContract implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String id;

	@Column(name="ANNEX_FLAG")
	private int annexFlag;
	
	private String pid;
	private String pname;

	@Column(name="REGION_MGR")
	private String regionMgr;

	private String construct;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="CREATE_TIME")
	private Date createTime;

	@Column(name="CUST_CITY")
	private String custCity;

	@Column(name="CUST_NAME")
	private String custName;

	private String interior;

	private String name;

	private String operator;

	private String phone;

	private String pm;

	private BigDecimal price;

	@Column(name="SUPPLIER_ID")
	private String supplierId;
	
	private String remarks;

	@Column(name="SHIPPING_ADDRESS")
	private String shippingAddress;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="SIGN_DATE")
	private Date signDate;

	private String status;

	@Column(name="WARN_FLAG")
	private int warnFlag;

	//bi-directional many-to-one association to BmeAcception
	@OneToMany(mappedBy="bmeContract")
	private List<BmeAcception> bmeAcceptions;

	//bi-directional many-to-one association to BmeContProd
	@OneToMany(mappedBy="bmeContract")
	private List<BmeContProd> bmeContProds;

	//bi-directional many-to-one association to BmeContPurch
	@OneToMany(mappedBy="bmeContract")
	private List<BmeContPurch> bmeContPurches;

	//bi-directional many-to-one association to BmeCustomer
	@ManyToOne
	@JoinColumn(name="CUST_ID")
	private BmeCustomer bmeCustomer;

	//bi-directional many-to-one association to BmeInvInfo
	@OneToMany(mappedBy="bmeContract")
	private List<BmeInvInfo> bmeInvInfos;

	//bi-directional many-to-one association to BmePayroll
	@OneToMany(mappedBy="bmeContract")
	private List<BmePayroll> bmePayrolls;

	//bi-directional many-to-one association to BmePurchOrder
	@OneToMany(mappedBy="bmeContract")
	private List<BmePurchOrder> bmePurchOrders;

	//bi-directional many-to-one association to BmeReceipt
	@OneToMany(mappedBy="bmeContract")
	private List<BmeReceipt> bmeReceipts;

	//bi-directional many-to-one association to BmeRptInfo
	@OneToMany(mappedBy="bmeContract")
	private List<BmeRptInfo> bmeRptInfos;

	//bi-directional many-to-one association to BmeRtnInfo
	@OneToMany(mappedBy="bmeContract")
	private List<BmeRtnInfo> bmeRtnInfos;

	//bi-directional many-to-one association to BmeSaleout
	@OneToMany(mappedBy="bmeContract")
	private List<BmeSaleout> bmeSaleouts;

	public BmeContract() {
	}

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public int getAnnexFlag() {
		return this.annexFlag;
	}

	public void setAnnexFlag(int annexFlag) {
		this.annexFlag = annexFlag;
	}

	public String getConstruct() {
		return this.construct;
	}

	public void setConstruct(String construct) {
		this.construct = construct;
	}

	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getCustCity() {
		return this.custCity;
	}

	public void setCustCity(String custCity) {
		this.custCity = custCity;
	}

	public String getCustName() {
		return this.custName;
	}

	public void setCustName(String custName) {
		this.custName = custName;
	}

	public String getInterior() {
		return this.interior;
	}

	public void setInterior(String interior) {
		this.interior = interior;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getOperator() {
		return this.operator;
	}

	public void setOperator(String operator) {
		this.operator = operator;
	}

	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getPm() {
		return this.pm;
	}

	public void setPm(String pm) {
		this.pm = pm;
	}

	public BigDecimal getPrice() {
		return this.price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	public String getRemarks() {
		return this.remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public String getShippingAddress() {
		return this.shippingAddress;
	}

	public void setShippingAddress(String shippingAddress) {
		this.shippingAddress = shippingAddress;
	}

	public Date getSignDate() {
		return this.signDate;
	}

	public void setSignDate(Date signDate) {
		this.signDate = signDate;
	}

	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getSupplierId() {
		return supplierId;
	}

	public void setSupplierId(String supplierId) {
		this.supplierId = supplierId;
	}

	public int getWarnFlag() {
		return this.warnFlag;
	}

	public void setWarnFlag(int warnFlag) {
		this.warnFlag = warnFlag;
	}

	public List<BmeAcception> getBmeAcceptions() {
		return this.bmeAcceptions;
	}

	public void setBmeAcceptions(List<BmeAcception> bmeAcceptions) {
		this.bmeAcceptions = bmeAcceptions;
	}

	public BmeAcception addBmeAcception(BmeAcception bmeAcception) {
		getBmeAcceptions().add(bmeAcception);
		bmeAcception.setBmeContract(this);

		return bmeAcception;
	}

	public BmeAcception removeBmeAcception(BmeAcception bmeAcception) {
		getBmeAcceptions().remove(bmeAcception);
		bmeAcception.setBmeContract(null);

		return bmeAcception;
	}

	public List<BmeContProd> getBmeContProds() {
		return this.bmeContProds;
	}

	public void setBmeContProds(List<BmeContProd> bmeContProds) {
		this.bmeContProds = bmeContProds;
	}

	public BmeContProd addBmeContProd(BmeContProd bmeContProd) {
		getBmeContProds().add(bmeContProd);
		bmeContProd.setBmeContract(this);

		return bmeContProd;
	}

	public BmeContProd removeBmeContProd(BmeContProd bmeContProd) {
		getBmeContProds().remove(bmeContProd);
		bmeContProd.setBmeContract(null);

		return bmeContProd;
	}

	public List<BmeContPurch> getBmeContPurches() {
		return this.bmeContPurches;
	}

	public void setBmeContPurches(List<BmeContPurch> bmeContPurches) {
		this.bmeContPurches = bmeContPurches;
	}

	public BmeContPurch addBmeContPurch(BmeContPurch bmeContPurch) {
		getBmeContPurches().add(bmeContPurch);
		bmeContPurch.setBmeContract(this);

		return bmeContPurch;
	}

	public BmeContPurch removeBmeContPurch(BmeContPurch bmeContPurch) {
		getBmeContPurches().remove(bmeContPurch);
		bmeContPurch.setBmeContract(null);

		return bmeContPurch;
	}

	public BmeCustomer getBmeCustomer() {
		return this.bmeCustomer;
	}

	public void setBmeCustomer(BmeCustomer bmeCustomer) {
		this.bmeCustomer = bmeCustomer;
	}

	public List<BmeInvInfo> getBmeInvInfos() {
		return this.bmeInvInfos;
	}

	public void setBmeInvInfos(List<BmeInvInfo> bmeInvInfos) {
		this.bmeInvInfos = bmeInvInfos;
	}

	public BmeInvInfo addBmeInvInfo(BmeInvInfo bmeInvInfo) {
		getBmeInvInfos().add(bmeInvInfo);
		bmeInvInfo.setBmeContract(this);

		return bmeInvInfo;
	}

	public BmeInvInfo removeBmeInvInfo(BmeInvInfo bmeInvInfo) {
		getBmeInvInfos().remove(bmeInvInfo);
		bmeInvInfo.setBmeContract(null);

		return bmeInvInfo;
	}

	public List<BmePayroll> getBmePayrolls() {
		return this.bmePayrolls;
	}

	public void setBmePayrolls(List<BmePayroll> bmePayrolls) {
		this.bmePayrolls = bmePayrolls;
	}

	public BmePayroll addBmePayroll(BmePayroll bmePayroll) {
		getBmePayrolls().add(bmePayroll);
		bmePayroll.setBmeContract(this);

		return bmePayroll;
	}

	public BmePayroll removeBmePayroll(BmePayroll bmePayroll) {
		getBmePayrolls().remove(bmePayroll);
		bmePayroll.setBmeContract(null);

		return bmePayroll;
	}

	public List<BmePurchOrder> getBmePurchOrders() {
		return this.bmePurchOrders;
	}

	public void setBmePurchOrders(List<BmePurchOrder> bmePurchOrders) {
		this.bmePurchOrders = bmePurchOrders;
	}

	public BmePurchOrder addBmePurchOrder(BmePurchOrder bmePurchOrder) {
		getBmePurchOrders().add(bmePurchOrder);
		bmePurchOrder.setBmeContract(this);

		return bmePurchOrder;
	}

	public BmePurchOrder removeBmePurchOrder(BmePurchOrder bmePurchOrder) {
		getBmePurchOrders().remove(bmePurchOrder);
		bmePurchOrder.setBmeContract(null);

		return bmePurchOrder;
	}

	public List<BmeReceipt> getBmeReceipts() {
		return this.bmeReceipts;
	}

	public void setBmeReceipts(List<BmeReceipt> bmeReceipts) {
		this.bmeReceipts = bmeReceipts;
	}

	public BmeReceipt addBmeReceipt(BmeReceipt bmeReceipt) {
		getBmeReceipts().add(bmeReceipt);
		bmeReceipt.setBmeContract(this);

		return bmeReceipt;
	}

	public BmeReceipt removeBmeReceipt(BmeReceipt bmeReceipt) {
		getBmeReceipts().remove(bmeReceipt);
		bmeReceipt.setBmeContract(null);

		return bmeReceipt;
	}

	public List<BmeRptInfo> getBmeRptInfos() {
		return this.bmeRptInfos;
	}

	public void setBmeRptInfos(List<BmeRptInfo> bmeRptInfos) {
		this.bmeRptInfos = bmeRptInfos;
	}

	public BmeRptInfo addBmeRptInfo(BmeRptInfo bmeRptInfo) {
		getBmeRptInfos().add(bmeRptInfo);
		bmeRptInfo.setBmeContract(this);

		return bmeRptInfo;
	}

	public BmeRptInfo removeBmeRptInfo(BmeRptInfo bmeRptInfo) {
		getBmeRptInfos().remove(bmeRptInfo);
		bmeRptInfo.setBmeContract(null);

		return bmeRptInfo;
	}

	public List<BmeRtnInfo> getBmeRtnInfos() {
		return this.bmeRtnInfos;
	}

	public void setBmeRtnInfos(List<BmeRtnInfo> bmeRtnInfos) {
		this.bmeRtnInfos = bmeRtnInfos;
	}

	public BmeRtnInfo addBmeRtnInfo(BmeRtnInfo bmeRtnInfo) {
		getBmeRtnInfos().add(bmeRtnInfo);
		bmeRtnInfo.setBmeContract(this);

		return bmeRtnInfo;
	}

	public BmeRtnInfo removeBmeRtnInfo(BmeRtnInfo bmeRtnInfo) {
		getBmeRtnInfos().remove(bmeRtnInfo);
		bmeRtnInfo.setBmeContract(null);

		return bmeRtnInfo;
	}

	public List<BmeSaleout> getBmeSaleouts() {
		return this.bmeSaleouts;
	}

	public void setBmeSaleouts(List<BmeSaleout> bmeSaleouts) {
		this.bmeSaleouts = bmeSaleouts;
	}

	public BmeSaleout addBmeSaleout(BmeSaleout bmeSaleout) {
		getBmeSaleouts().add(bmeSaleout);
		bmeSaleout.setBmeContract(this);

		return bmeSaleout;
	}

	public BmeSaleout removeBmeSaleout(BmeSaleout bmeSaleout) {
		getBmeSaleouts().remove(bmeSaleout);
		bmeSaleout.setBmeContract(null);

		return bmeSaleout;
	}

	public String getPid() {
		return pid;
	}

	public void setPid(String pid) {
		this.pid = pid;
	}

	public String getPname() {
		return pname;
	}

	public void setPname(String pname) {
		this.pname = pname;
	}
	
	public String getRegionMgr() {
		return regionMgr;
	}

	public void setRegionMgr(String regionMgr) {
		this.regionMgr = regionMgr;
	}
}